<?php
declare (strict_types=1);

namespace app\api\controller;

use app\api\model\Setting as SettingModel;
use app\common\enum\Setting as SettingEnum;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\response\Json;

/**
 * 设置控制器
 * Class Setting
 * @package app\store\controller
 */
class Setting extends Controller
{
    /**
     * 公共设置(仅展示可公开的信息)
     * @return array|Json
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function data()
    {
        $values = SettingModel::getItem(SettingEnum::H5HOME);
        return $this->renderSuccess(compact('values'));
    }
}
